package com.jsh.ex.controller;

import com.jsh.ex.dao.UserInfoMapper;
import com.jsh.ex.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import springfox.documentation.annotations.ApiIgnore;

/**
 * Created by wukai on 2017/9/11.
 */
@ApiIgnore
@Controller
public class HomeController {
    @Autowired
    private UserInfoMapper userInfoMapper;
    @RequestMapping(value = "/home")
    public String home(Model model){
        UserInfo userInfo = new UserInfo();
        userInfo.setLoginname("xx");
        userInfo.setLoginpwd("123");
        userInfo.setUserid(13);
        int num = userInfoMapper.insertSelective(userInfo);
        model.addAttribute("name","spring-boot sb:"+num);
        return "index";
    }
}
